<!--损益表-->
<div class="form-inline">
    <div class="form-group">
        <input type="month" onchange="Page.change_month(this)" class="form-control" value="<?php echo yii::$app->request->get('m')?yii::$app->request->get('m'):date('Y-m');?>" />
    </div>
</div>
<br/>
<div class="col-xs-6 col-lg-6 col-sm-6">

        <table class="table table-borderd">
            <thead>
                <tr>
                    <th style="background:rgb(47,117,181);color:white" colspan=2>项目</th>
                    <th style="background:rgb(47,117,181);color:white">行次</th>
                    <th style="background:rgb(47,117,181);color:white">本月数</th>
                    <th style="background:rgb(47,117,181);color:white">本年累计数</th>
                </tr>
            </thead>
            <tbody>
                <tr class="td_warn">
                    <td colspan=2>一.主营业务收入</td>
                    <td>1</td>
                    <td><?php $info = $this->params['info'];echo $income_m = round($info['all_income']['month']['income'],2);?></td>
                    <td><?php echo $income_y = round($info['all_income']['year']['income'],2);?></td>
                </tr>
                <tr>
                    <td></td>
                    <td>订单产品成本</td>
                    <td>2</td>
                    <td><?php echo $product_month = $info['product_pay']['month']['in_money']-$info['product_pay']['month']['out_money'];?></td>
                    <td><?php echo $product_year = $info['product_pay']['year']['in_money']-$info['product_pay']['year']['out_money'];?></td>
                </tr>
                <tr>
                    <td></td>
                    <td>订单货运成本</td>
                    <td>3</td>
                    <td><?php echo $express_month = $info['express_pay']['month']['in_money']-$info['express_pay']['month']['out_money'];?></td>
                    <td><?php echo $express_year = $info['express_pay']['year']['in_money']-$info['express_pay']['year']['out_money'];?></td>
                </tr>
                <tr>
                    <td></td>
                    <td>费用支出</td>
                    <td>4</td>
                    <td><?php echo $fee_month = $info['fee_pay']['month']['in_money']-$info['fee_pay']['month']['out_money'];?></td>
                    <td><?php echo $fee_year = $info['fee_pay']['year']['in_money']-$info['fee_pay']['year']['out_money'];?></td>
                </tr>
                <tr>
                    <td></td>
                    <td>退税款</td>
                    <td>5</td>
                    <td><?php echo $tax_month = $info['tax_pay']['month']['in_money']-$info['tax_pay']['month']['out_money'];?></td>
                    <td><?php echo $tax_year = $info['tax_pay']['year']['in_money']-$info['tax_pay']['year']['out_money'];?></td>
                </tr>
                <tr class="td_warn">
                    <td colspan=2> 二.主营业务利润（亏损以“-”号填列）</td>
                    <td>6</td>
                    <td>0</td>
                    <td>0</td>
                </tr>
                <tr>
                    <td></td>
                    <td> 加：其他业务利润（亏损以“-”号填列）</td>
                    <td>7</td>
                    <td>0</td>
                    <td>0</td>
                </tr>
                <tr>
                    <td></td>
                    <td> 减：营业费用</td>
                    <td>8</td>
                    <td><?php echo $business_month = $info['business_pay']['month']['in_money']-$info['business_pay']['month']['out_money'];?></td>
                    <td><?php echo $business_year = $info['business_pay']['year']['in_money']-$info['business_pay']['year']['out_money'];?></td>
                </tr>
                <tr>
                    <td></td>
                    <td> 管理费用</td>
                    <td>9</td>
                    <td><?php echo $manage_month = $info['manage_pay']['month']['in_money']-$info['manage_pay']['month']['out_money'];?></td>
                    <td><?php echo $manage_year = $info['manage_pay']['year']['in_money']-$info['manage_pay']['year']['out_money'];?></td>
                </tr>
                <tr>
                    <td></td>
                    <td> 财务费用</td>
                    <td>10</td>
                    <td><?php echo $finance_month = $info['finance_pay']['month']['in_money']-$info['finance_pay']['month']['out_money'];?></td>
                    <td><?php echo $finance_year = $info['finance_pay']['year']['in_money']-$info['finance_pay']['year']['out_money'];?></td>
                </tr>
                <tr class="td_warn">
                    <td colspan=2>三.营业利润（亏损以“-”号填列）</td>
                    <td>11</td>
                    <td>0</td>
                    <td>0</td>
                </tr>
                <tr>
                    <td></td>
                    <td> 加：投资收益</td>
                    <td>12</td>
                    <td>0</td>
                    <td>0</td>
                </tr>
                <tr>
                    <td></td>
                    <td> 补贴收入</td>
                    <td>13</td>
                    <td>0</td>
                    <td>0</td>
                </tr>
                <tr>
                    <td></td>
                    <td> 营业外收入</td>
                    <td>14</td>
                    <td><?php echo $other_income_month = $info['others_income']['month']['in_money']-$info['others_income']['month']['out_money'];?></td>
                    <td><?php echo $other_income_year = $info['others_income']['year']['in_money']-$info['others_income']['year']['out_money'];?></td>
                </tr>
                <tr>
                    <td></td>
                    <td> 减: 营业外支出</td>
                    <td>15</td>
                    <td><?php echo $others_month = $info['others_pay']['month']['in_money']-$info['others_pay']['month']['out_money'];?></td>
                    <td><?php echo $others_year = $info['others_pay']['year']['in_money']-$info['others_pay']['year']['out_money'];?></td>
                </tr>
                <tr class="td_warn">
                    <td colspan=2> 四.利润总额（亏损总额以“-”号填列）</td>
                    <td>16</td>
                    <td>0</td>
                    <td>0</td>
                </tr>
                <tr>
                    <td></td>
                    <td> 减：所得税</td>
                    <td>17</td>
                    <td>0</td>
                    <td>0</td>
                </tr>
                <tr class="td_warn">
                    <td colspan=2> 五.净利润（净亏损以“-”号填列）</td>
                    <td>18</td>
                    <td><?php echo round($income_m+$product_month+$express_month+$fee_month+$tax_month+$business_month+$manage_month+$finance_month+$other_income_month+$others_month,2);?></td>
                    <td><?php echo round($income_y+$product_year+$express_year+$fee_year+$tax_year+$business_year+$manage_year+$finance_year+$other_income_year+$others_year,2);?></td>
                </tr>
            </tbody>
        </table>
    </div>
    <script>
    Page.change_month=function(e){
        window.location.href="/table/finance?type=<?php echo $_GET['type']??4;?>&m="+e.value;
    }
    </script>